﻿@using System.Activities.Expressions
@using BusinessClasses
@{
    ViewBag.Title = "SubCategory Master";
    var activeCategories = (List<ActiveCategory>)ViewBag.ActiveCategoryInfo;
}


<link href="~/Content/dataTables.bootstrap.css" rel="stylesheet" />
<script src="~/Scripts/jquery.dataTables.min.js"></script>
<script src="~/Scripts/dataTables.bootstrap.js"></script>
<link href="~/Content/ViewCss/SubCategoryMaster.css" rel="stylesheet" />

<div class="CategoryMasterMainDiv">
    <div class="page-header" style="margin: auto !important">
        <h1 id="tables" style="text-align: center">Sub-Category Master</h1>


        <input type="text" class="form-control" style="float:left;width: 41%" placeholder="Search SubCategory" id="txtSearchSubCategory">
        <button type="submit" class="btn btn-default" style="margin-left:1% ">Search</button>
        <button type="button" class="btn btn-default" style="float:right" data-toggle="modal" data-target="#popup" data-subcategoryid="0">Add Sub-Category</button>




    </div>
    <div id="divSubCategoryTable">
        @{ Html.RenderAction("ShowSubCategoryTable");}
    </div>

    @* PopUpDivs *@

    <div class="modal " id="popup">
        <div class="modal-dialog center">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title center">Modal title</h4>
                </div>
                <div class="modal-body">
                    <input type="text" placeholder="Sub-Category Name" id="txtSubCategoryName" class="form-control" data-container="body" data-placement="right" data-content="Looks like this Subcategory is already Present!!!">

                    <select class="form-control PopUpDropDown" id="ddlCategory" data-content="Please Select Category!!!">
                        <option value="0">Category Name</option>
                        @foreach (var category in activeCategories)
                        {
                            <option value="@category.CategoryId">@category.CategoryName</option>
                        }
                    </select>
                    <input type="checkbox" id="chkIsVisible" style="margin-top: 3%;margin-right: 1%;">Show SubCategory
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary" id="btnSaveChanges">Save changes</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="~/Scripts/ViewScript/SubCategoryMaster.js"></script>